<style scoped>
  .expand-row{
    margin-bottom: 16px;
  }
  .lyx-table-btn{
    margin-right: 5px;
    margin-bottom: 2px;
  }
  .title-size {
    font-weight: bold;
    font-size: 1rem;
  }
</style>
<template>
  <div>
      <Form label-position="right" :label-width="100" style="position: relative;" :model="formDate">
        <Row class="mb20">
          <Col span="13" class="ivu-form-item-label title-size">特殊情况</Col>
        </Row>
        <Row class="mb20">
          <Col span="5" class="ivu-form-item-label">重大疾病：</Col>
          <Col span="3" offset="1" class="ivu-form-item-content">
            <RadioGroup>
              <Radio label="是">是</Radio>
              <Radio label="否">否</Radio>
            </RadioGroup>
          </Col>
          <Col span="1" class="ivu-form-item-label">共</Col>
          <Col span="3" class="ivu-form-item-content">
            <Input v-model="formDate.bigDeformityNum"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
        </Row>
        <Row class="mb20">
          <Col span="5" class="ivu-form-item-label">残疾：</Col>
          <Col span="2" offset="1" class="ivu-form-item-label" style="text-align: left">一级残疾共</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.deformityNum1"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
          <Col span="2" class="ivu-form-item-label">二级残疾共</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.deformityNum2"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
          <Col span="4" class="ivu-form-item-label">三级残疾(含低视力一级)共</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.deformityNum3"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
        </Row>
        <Row class="mb20">
          <Col span="4" offset="6" class="ivu-form-item-label" style="text-align: left">四级残疾(含低视力二级)共</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.deformityNum4"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
          <Col span="7" class="ivu-form-item-label">说明：一人有多个残疾证的按最高残疾等级计算</Col>
        </Row>
        <Row class="mb20">
          <Col span="5" class="ivu-form-item-label">老龄：</Col>
          <Col span="3" offset="1" class="ivu-form-item-label" style="text-align: left">70周岁(含)以上</Col>
          <Col span="2" class="ivu-form-item-content">
            <RadioGroup v-model="old_age">
              <Radio label="是">是</Radio>
              <Radio label="否">否</Radio>
            </RadioGroup>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="5" offset="6" class="ivu-form-item-label" style="text-align: left">多名老龄的每人实际年龄</Col>
          <Col span="2" class="ivu-form-item-content">
            <Input v-model="formDate.agingManAge" ></Input>
          </Col>
          <Col span="9" class="ivu-form-item-label">说明：输入多名老龄的每人实际年龄按","分开，如：75,73</Col>
        </Row>
        <Row class="mb20">
          <Col span="5" class="ivu-form-item-label">孤独：</Col>
          <Col span="3" offset="1" class="ivu-form-item-label" style="text-align: left">60周岁(含)以上</Col>
          <Col span="2" class="ivu-form-item-content">
            <RadioGroup v-model="formDate.lonelyManAge">
              <Radio label="1">是</Radio>
              <Radio label="0">否</Radio>
            </RadioGroup>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="5" class="ivu-form-item-label">贡献：</Col>
          <Col span="3" offset="1" class="ivu-form-item-label" style="text-align: left">国家劳动模范共</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.dedicationNum1"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
          <Col span="3" class="ivu-form-item-label">省劳动模范共</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.dedicationNum2"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
          <Col span="4" class="ivu-form-item-label">市劳动模范共</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.dedicationNum3"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
        </Row>
        <Row class="mb20">
          <Col span="4" offset="6" class="ivu-form-item-label" style="text-align: left">县(市)、区劳动模范共</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.dedicationNum4"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
          <Col span="7" class="ivu-form-item-label">说明：一人多次获得劳模的按最高等级计算</Col>
        </Row>
        <Row class="mb20">
          <Col span="5" class="ivu-form-item-label">优抚对象：</Col>
          <Col span="8" offset="1" style="text-align: left">
            <Checkbox v-model="formDate.youfuType1">持《定期抚恤证》的</Checkbox>
            <Checkbox  v-model="formDate.youfuType2">持《定期定量补助证》人员</Checkbox>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="5" class="ivu-form-item-label">复转军人：</Col>
          <Col span="3" offset="1" class="ivu-form-item-label" style="text-align: left">解放战争时期共</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.soldierNum1"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
          <Col span="4" class="ivu-form-item-label">1954年10月31以前共</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.soldierNum2"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
          <Col span="4" class="ivu-form-item-label">1954年11月1日以后共</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.soldierNum3"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
        </Row>
        <Row class="mb20">
          <Col span="13" class="ivu-form-item-label title-size">人口代际</Col>
        </Row>
        <Row class="mb20">
          <Col span="5" class="ivu-form-item-label">人口：</Col>
          <Col span="3" offset="1" class="ivu-form-item-label" style="text-align: left">家庭3口人(含)以下</Col>
          <Col span="2" class="ivu-form-item-content">
            <RadioGroup v-model="formDate.isRK">
              <Radio :label="item.value" v-for="item in sankouren" :value="item.value" :key="item.value">{{item.label}}</Radio>
<!--              <Radio label="0">否</Radio>-->
            </RadioGroup>
          </Col>
          <Col span="2" class="ivu-form-item-label">家庭人口数</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.rkNum"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">人</Col>
        </Row>
        <Row class="mb20">
          <Col span="5" class="ivu-form-item-label">代际：</Col>
          <Col span="3" offset="1" class="ivu-form-item-label" style="text-align: left">两代(含)以下</Col>
          <Col span="2" class="ivu-form-item-content">
            <RadioGroup v-model="formDate.isDJ">
              <Radio :label="item.value" v-for="item in liangdai" :value="item.value" :key="item.value">{{item.label}}</Radio>
            </RadioGroup>
          </Col>
          <Col span="2" class="ivu-form-item-label">家庭代际数</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.djNum"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">代</Col>
        </Row>
        <Row class="mb20">
          <Col span="5" class="ivu-form-item-label">轮侯：</Col>
          <Col span="3" offset="1" class="ivu-form-item-label" style="text-align: left">家庭轮侯</Col>
          <Col span="1" class="ivu-form-item-content">
            <Input v-model="formDate.waitYear"></Input>
          </Col>
          <Col span="1" class="ivu-form-item-label">年</Col>
        </Row>
        <Row class="mb20">
          <Col span="22" offset="1" class="ivu-form-item-content">
            <Table border :columns="columns1" :data="tempData.personPaperList1">
            </Table>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="13" class="ivu-form-item-label">
            <Button @click="save()">提交家庭特殊情况</Button>
          </Col>
        </Row>
    </Form>
  </div>
</template>
<script>
// import { itemParamByOrderList } from '@/api/eventlist'
export default {
  name: 'Form9_2',
  data () {
    return {
      name_list: [],
      sankouren: [{ value: 1, label: '是' }, { value: 0, label: '否' }],
      liangdai: [{ value: 1, label: '是' }, { value: 0, label: '否' }],
      bwk: '0',
      paramsArr: [],
      list: [],
      sectionList: [],
      streetList: [],
      committeesList: [],
      batchList: [],
      person_list: [],
      old_age: '否',
      paper_list: [
        { label: '优抚', value: '1' },
        { label: '大病', value: '2' },
        { label: '重残', value: '3' },
        { label: '老龄', value: '4' },
        { label: '残疾', value: '5' },
        { label: '孤独', value: '6' }
      ],
      columns1: [
        {
          title: '姓名',
          key: 'name',
          render: (h, params) => {
            return h('Select', {
              props: {
                value: params.row.name, // 获取选择的下拉框的值
                transfer: true
              },
              on: {
                'on-change': event => {
                  this.tempData.personPaperList1[params.index].name = event
                }

              }
            }, this.name_list.map((item) => { // this.productTypeList下拉框里的data
              return h('Option', { // 下拉框的值
                props: {
                  value: item
                }
              }, item)
            }))
          }
        },
        {
          title: '证件名称',
          key: 'paperName',
          render: (h, params) => {
            return h('Select', {
              props: {
                value: params.row.paperName, // 获取选择的下拉框的值
                transfer: true
              },
              on: {
                'on-change': event => {
                  this.tempData.personPaperList1[params.index].paperName = event
                }

              }
            }, this.paper_list.map((item) => { // this.productTypeList下拉框里的data
              return h('Option', { // 下拉框的值
                props: {
                  value: item.value
                }
              }, item.label)
            }))
          }
        },
        {
          title: '证件编号',
          key: 'paperNumber',
          render: (h, params) => {
            let temp = []
            temp.push(h('Input', {
              props: {
                value: params.row.paperNumber,
                autosize: true
              },
              on: {
                'on-blur': (event) => {
                  console.log(event, 'event')
                  this.tempData.personPaperList1[params.index].paperNumber = event.target.value
                }
              }
            }))
            return h('div', temp)
          }
        },
        {
          title: '发证日期',
          key: 'issueDate',
          render: (h, params) => {
            let temp = []
            temp.push(h('DatePicker', {
              props: {
                value: params.row.issueDate,
                autosize: true
              },
              on: {
                'on-change': event => {
                  this.tempData.personPaperList1[params.index].issueDate = event
                }
              }
            }))
            return h('div', temp)
          }
        }
      ]
    }
  },
  props: {
    formDate: Object,
    tempData: Object,
    ruleData: Object,
    ruleObj: Object
  },
  mounted () {
    this.formDate.lonelyManAge = '1'
    if (this.formDate.personList) {
      for (var i = 0; i < this.formDate.personList.length; i++) {
        this.name_list.push(this.formDate.personList[i].bz_name)
        console.log(this.name_list, 'xingmung下拉框')
      }
    }
  },
  watch: {
  },
  methods: {
    save () {
      this.formDate.personPaperList = []
      console.log(this.tempData.personPaperList1)
      for (var i = 0; i < this.tempData.personPaperList1.length; i++) {
        if (this.tempData.personPaperList1[i].name !== '') {
          this.formDate.personPaperList.push(this.tempData.personPaperList1[i])
        }
      }
      console.log(this.formDate)
      this.$emit('ee')
    }
  }
}
</script>
